﻿<%@ Page Title="山珍海味聚宝盆，立减60-190元，5人成团" Language="C#" MasterPageFile="~/Wap/Shop/ShopSite.Master" AutoEventWireup="true" CodeBehind="Pinbuying.aspx.cs" Inherits="ZLCMS.Web.Wap.Shop.Pinbuying" %>

<%@ Import Namespace ="ZLCMS.Business.Util" %>
<%@ Import Namespace ="Newtonsoft.Json.Linq" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
    <style type="text/css">
	.suspension_icon{ position:fixed; bottom:85px; right:10px; width:30px; z-index:99;}
	.suspension_icon div{ margin-bottom:10px;}
	.suspension_icon div img{ width:30px;}
	.suspension_icon div.more{ position:relative; display:none;}
	.suspension_icon .more .home{ position:absolute; top:-40px; left:0;}
	.suspension_icon .more .me{ position:absolute; top:-20px; left:0;}
	.suspension_icon .more .search{ position:absolute; top:20px; left:0;}
    </style>

    <%if (TeamExisted && pbMain.Status == "1" && ProductData != null)//开团中
      { %>
   
    <script type="text/javascript">

        shareUrl = location.href; //分享链接
        shareTitle = '我参与了拼团活动“山珍海味聚宝盆，今年过年就吃这个了，立减60-190元”'; //分享标题
        shareLogo = '<%=ServerUtil.GetRootURI() %>/upload/xheditor/day_160106/p/pin_share.jpg'; //分享图标
        shareDesc = '【还差<%= pbMain.MinAmount - RepeaterMembers.Items.Count%>人】 融合佛跳墙和盘菜精华，含吉品干鲍、海参、蚝豉、元贝、花胶、土鸡、鸭掌、猪手'; //分享描述
    </script>
    <%} else{%>
    <script type="text/javascript">
        shareUrl = location.href; //分享链接
        shareTitle = '今年过年就吃这个了，山珍海味聚宝盆，立减60-190元，5人成团'; //分享标题
        shareLogo = '<%=ServerUtil.GetRootURI() %>/upload/xheditor/day_160106/p/pin_share.jpg'; //分享图标
        shareDesc = '融合佛跳墙和盘菜精华，含吉品干鲍、海参、蚝豉、元贝、花胶、土鸡、鸭掌、猪手'; //分享描述
    </script>
    <%} %>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="pages" runat="server">
<div data-role="page" id="mypage" class="spellcargo">
        <!--S header -->
        <div data-role="header">
        </div>
        <!--S content -->
        <div role="main" class="ui-content">
        
            <div class="box" style="margin: 0px; border: none;  padding: 0px;">
                <p style="text-align: center;">
                    <img style="width: 100%; margin-bottom: 1em;" src="/upload/xheditor/day_160106/p/pin_game.jpg">
                </p>
            </div>
            <div style="font-size: 12px; background-color:#fff; color: #666; padding: 5px;">请选择拼团产品：</div>
            <ul class="top">
                <asp:Repeater ID="RepeaterProduct" runat="server">
                <ItemTemplate>
                <li prop='<%#GetProductProp(Container.DataItem, "ProductNo")%>'>
                <div><a href="/Wap/Shop/ProductDetail.aspx?no=<%# GetProductProp(Container.DataItem, "ProductNo") %>" data-ajax="false"><img src="<%#GetProductProp(Container.DataItem, "ThumbnailImg") %>" /></a></div>
                <div>
                    <p class="pt"><%#GetProductProp(Container.DataItem, "ProductName")%></p>
                    <p class="pd"><%#GetProductProp(Container.DataItem, "ShortDesc")%></p>
                    <p class="pp">拼团价：<i><%#GetProductProp(Container.DataItem, "PinbuyingPrice")%></i>&nbsp;&nbsp;<del><%#GetProductProp(Container.DataItem, "SalePrice")%></del></p>
                </div>              
                </li>                
                </ItemTemplate>
                </asp:Repeater>
                </ul>
                <%if (TeamExisted)
                  { %>
            <ul class="list">
                <asp:Repeater ID="RepeaterMembers" runat="server">
                <ItemTemplate>
                <li><img src="<%#FileKit.FirstFilePath(((IDictionary)Container.DataItem)["PHOTO_URL"]) %>" /></li>
                </ItemTemplate>
                </asp:Repeater>
                
                <%for (int i = RepeaterMembers.Items.Count; i < pbMain.MinAmount; i++)
                  { %><li><img src="/wap/shop/images/defaut_header.jpg" /></li>
                
                <%} %>
            </ul>
            <div class="leader_box">
                <div class="leader">
                    <div class="header"><img src="<%=FileKit.FirstFilePath(pbTeamLeader["PHOTO_URL"]) %>" /></div>
                    <p>团长<%=pbTeamLeader["MEMBER_NAME"]%></p>
                    <span><%=pbTeamLeader["CREATE_DATE"]%>开团</span>
                </div>
            </div>
            <ul class="leader othermem">
            
                <asp:Repeater ID="RepeaterTeam" runat="server">
                <ItemTemplate>
                
                <li>
                    <div class="header"><img src="<%#FileKit.FirstFilePath(((IDictionary)Container.DataItem)["PHOTO_URL"]) %>" /></div>
                    <p>团员<%#((IDictionary)Container.DataItem)["MEMBER_NAME"]%></p>
                    <span><%#((IDictionary)Container.DataItem)["CREATE_DATE"]%>参团</span>
                </li>
                </ItemTemplate>
                </asp:Repeater>

            </ul>
            <%} %>
            
        <%if (TeamExisted && pbMain.Status == "1")//开团中，显示到期时间
          { %>
            <div class="box" style="font-size: 12px;">
                <div>到期时间：2016-01-15 00:00:00</div>
            </div>
          <%} %>
            <div class="box" style="font-size: 12px;">
                <p>拼团玩法<a class="step_more" href="http://gdtvshjzdbbs.weixinmvp.com/wap/bbs/ModuleView.aspx?uid=SHOP_PINBUY_HELP" data-ajax="false" style="font-weight: normal; color:#999; float: right;">查看详情</a></p>
                <p style="text-align: center;">
                    <img style="width: 100%; max-width: 400px; margin: 1em 0px;" src="images/pinbuy.png">
                </p>
                <p style=" color: #f9384d">邀请 <%= pbConfig.MinAmount %> 人参团，人数不足自动退款</p>
            </div>
            <div style="text-align: center; font-size: 12px; color: #aaa; text-shadow: 0px 1px 1px #fff;">广东电视台公共频道生活计仔多栏目商城</div>

            <div class="suspension_icon">
                <div><img src="images/icon_03.png" /></div>
                <div class="more"><img class="close" src="images/icon_18.png" />
                <a data-role="none"  href="/Wap/Shop/Default.aspx" data-ajax="false" ><img class="home" src="images/icon_08.png" /></a>
                <a data-role="none" href="http://gdtvshjzdbbs.weixinmvp.com/wap/bbs/MemberDefault.aspx" data-ajax="false"><img class="me" src="images/icon_10.png" /></a>
                <a data-role="none"  href="/Wap/Shop/ProductList.aspx" data-ajax="false" ><img class="search" src="images/icon_12.png" /></a></div>
                <div><a href="http://api.pop800.com/chat/166207" data-ajax="false" data-role="none"><img src="images/icon_06.png" /></a></div>
            </div>
        </div>
        <!--e content-->
        <!--S footer -->
        
        <div data-role="footer" data-position="fixed" data-tap-toggle="false" class="foot">
       <%-- <%if (pbMain.Status == "1")
          { %>
        <a>拼团中</a>
        <%}else if (pbMain.Status == "-1")
          { %>
        <a>过期</a>
        <%} else if (pbMain.Status == "9")
          { %>
        <a>成功</a>
        <%} %>--%>
        <%if (JoinEnable)
                  { %>
                <a  href="javascript:void(0)" onclick="requirePinbuying(<%=pbMain.Id %>)">立即参团</a>
                <%}
                  else if(!TeamExisted)
                  { %>
                <a href="javascript:void(0)" onclick="requirePinbuying(-1)">立即开团</a>
                <%} %>

        <%if (TeamExisted)
          { %>
           <a href="/wap/shop/Pinbuying.aspx?pbc=<%=pbConfig.Id %>" data-ajax="false">我也开个团</a>
        <%} %>
        </div>
        <!--E footer -->
    </div>

    <script type="text/javascript">
        $(function () {
            $('.spellcargo .list li').height($('.spellcargo .list li').width());
        })

        function requirePinbuying(mainId) {
            var productNo = $('li.active[prop]').attr('prop');
            if (!productNo) {
                alert('请选择产品');
                return;
            }
            $('#mypage').executeCommand({
                successCallBack: function (result) {
                    location.href = '/wap/shop/submitorder.aspx?pbp=' + result.PbProductId;
                }
            }, 'Member.RequirePinbuying', { ConfigId: '<%=pbConfig.Id %>', ProductNo: productNo, MainId: mainId });
        }

        $('.spellcargo .top li').click(function () {
            $(this).addClass('active').siblings().removeClass('active');
        })
        <%if(pbOrder == null){ %>
        <%} %>
          
    function lauchMore(){
        $('.suspension_icon div:nth-child(1)').click(function(){
            $(this).css('display','none');
            $('.suspension_icon .more').show();
            $('.suspension_icon .more .home').animate({'left':'-5px'},100);
            $('.suspension_icon .more .me').animate({'left':'-40px'},100);
            $('.suspension_icon .more .search').animate({'left':'-40px'},100);
        });
        $('.suspension_icon .more .close').click(function(){
            $(this).parent().css('display','none');
            $('.suspension_icon .more .home').css({'left':0});
            $('.suspension_icon .more .me').css({'left':0});
            $('.suspension_icon .more .search').css({'left':0});
            $('.suspension_icon div:nth-child(1)').show();
        });
    }
    lauchMore();

    function moredetails(){
        $('.moredetails').click(function(){
            $(this).hide();
            $('.productcommodityDesc').show();
            $('.moredetails').executeCommand({
                successCallBack: function (result) {
                    $('.commoditydesc').data('content', result.Description);
                    $('.commodityparam').data('content', result.ParamContent);
                    $('.productcommodity').html($('.productcommodityDesc ul.header li.active').data('content'));
                    $(window).scrollTop($('.productcommodityDesc').offset().top - 200);
                }
            }, 'Pub.LoadProductDetailDesc', { ProductNo: '<%=Request["no"] %>' });
            
            $('.productcommodityDesc ul.header li').click(function () {
                $('.productcommodityDesc ul.header li').removeClass('active');
                $(this).addClass('active');
                $('.productcommodity').html($('.productcommodityDesc ul.header li.active').data('content'));
            });
        });
        $(document).scroll(function(){
            if($(window).scrollTop() >= $('.productcommodityDesc').offset().top){
                $('#productcommoditytabs').addClass('fixedhead')
            }else{
                $('#productcommoditytabs').removeClass('fixedhead')
            }
        });
    }

    moredetails();
    </script>
</asp:Content>
